package User;

import Books.BooksList;
import IOPerations.*;

import java.util.Scanner;

public class UserAdmin extends User{

    @Override
    public void doOperations(int val, BooksList bookslist) {
        iOperations[val].work(bookslist);
    }

    public UserAdmin(String name) {
        super(name);
        this.iOperations = new IOperations[]{
                new ExitOperations(),
                new FindOperations(),
                new AddOperations(),
                new DelOperations(),
                new ShowOperations(),
        };
    }

    @Override
    public int meun() {
        System.out.println( "====="+this.getName()+"-管理员菜单======");
        System.out.println("1.查找图书");
        System.out.println("2.新增图书");
        System.out.println("3.删除图书");
        System.out.println("4.显示图书");
        System.out.println("0.退出系统");
        System.out.println("==========================");
        System.out.print("请输入你的操作：");
        Scanner scanner = new Scanner(System.in);
        int cmp = scanner.nextInt();
        return cmp;
    }

}
